package com.example.myproject.zebra;

import com.example.myproject.zebra.demo1.SysPlanBetEntity;

import java.math.BigDecimal;

/**
 * zpl 打印中文三种方案
 * 1 tsdl 点阵打印，点阵好像变化字体样式和大小，只能缩放倍率
 * 2 使用字体库打印 https://blog.csdn.net/oonukeoo/article/details/81533851
 * 3 把文字变为图片在打印
 */
public class MyTest {

    private static  String content="";


    public static void main(String[] args) {

        SysPlanBetEntity planBet = new SysPlanBetEntity();
        planBet.setTargetName("钢筋混凝土用热轧带肋钢筋");
        planBet.setMark("HRB400E");
        planBet.setNorms("Φ10");
        planBet.setMatNo("123456789012");
        planBet.setLicNo("XK05-001-00727");
        planBet.setExeSta("GB/T1499.2-2018");
        planBet.setTaskId("D1740001");
        planBet.setMatPraWei(new BigDecimal(12300));
        planBet.setClassCode("甲jia");


        String bar3 ="产品名称:"+planBet.getTargetName()+" 重量:"+Double.toString(23)+"kg"+"规格:"+planBet.getNorms()+"牌号:"+planBet.getMark();//12位^CI26
        MyTest myTest = new MyTest();
        String bar3Paper ="^FO18,558^BQ,2,3^CI26^FH^FDQA,${data}^FS";//二维码样式模板 QA 高可靠性级别CI26 qa 支持中文
        myTest.setBarCode(bar3,bar3Paper);
    }

    public static void setBarCode(String barcode,String zpl){
        content += zpl.replace("${data}", barcode);
        //二维码
    }
}
